Optimal. Leaf size=19 \[ -\frac{1}{3} \cos ^3(x)-\frac{1}{3} i \sin ^3(x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.100203, antiderivative size = 19, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 6, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.546, Rules used = {3518, 3108, 3107, 2565, 30, 2564} \[ -\frac{1}{3} \cos ^3(x)-\frac{1}{3} i \sin ^3(x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3518
Rule 3108
Rule 3107
Rule 2565
Rule 30
Rule 2564
Rubi steps
\begin{align*} \int \frac{\cos (x)}{i+\cot (x)} \, dx &=-\int \frac{\cos (x) \sin (x)}{-\cos (x)-i \sin (x)} \, dx\\ &=i \int \cos (x) (-i \cos (x)-\sin (x)) \sin (x) \, dx\\ &=i \int \left (-i \cos ^2(x) \sin (x)-\cos (x) \sin ^2(x)\right ) \, dx\\ &=-\left (i \int \cos (x) \sin ^2(x) \, dx\right )+\int \cos ^2(x) \sin (x) \, dx\\ &=-\left (i \operatorname{Subst}\left (\int x^2 \, dx,x,\sin (x)\right )\right )-\operatorname{Subst}\left (\int x^2 \, dx,x,\cos (x)\right )\\ &=-\frac{1}{3} \cos ^3(x)-\frac{1}{3} i \sin ^3(x)\\ \end{align*}
Mathematica [A] time = 0.0129601, size = 19, normalized size = 1. \[ \frac{1}{3} \left (-\cos ^3(x)-i \sin ^3(x)\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.041, size = 49, normalized size = 2.6 \begin{align*}{-{\frac{i}{2}} \left ( \tan \left ({\frac{x}{2}} \right ) +i \right ) ^{-1}}+{{\frac{i}{2}} \left ( \tan \left ({\frac{x}{2}} \right ) -i \right ) ^{-1}}-{{\frac{2\,i}{3}} \left ( \tan \left ({\frac{x}{2}} \right ) -i \right ) ^{-3}}- \left ( \tan \left ({\frac{x}{2}} \right ) -i \right ) ^{-2} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.58872, size = 89, normalized size = 4.68 \begin{align*} -\frac{1}{12} \,{\left (3 \,{\left (e^{\left (2 i \, x\right )} - 1\right )} e^{\left (2 i \, x\right )} + 3 \, e^{\left (2 i \, x\right )} + 1\right )} e^{\left (-3 i \, x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.679012, size = 17, normalized size = 0.89 \begin{align*} - \frac{e^{i x}}{4} - \frac{e^{- 3 i x}}{12} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.23977, size = 42, normalized size = 2.21 \begin{align*} -\frac{i}{2 \,{\left (\tan \left (\frac{1}{2} \, x\right ) + i\right )}} - \frac{-3 i \, \tan \left (\frac{1}{2} \, x\right )^{2} + i}{6 \,{\left (\tan \left (\frac{1}{2} \, x\right ) - i\right )}^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]